<!--
 * @Author: WangGuojian 1085844536@qq.com
 * @Date: 2024-07-03 11:07:03
 * @LastEditTime: 2024-07-03 11:46:28
 * @LastEditors: WangGuojian 1085844536@qq.com
 * @FilePath: \html\code\2_CSS\16_CSS_盒子模型\24_CSS_布局小技巧3.html
 * @Description:
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS_布局小技巧3</title>
    <style>
        .outer {
            width: 400px;
            height: 400px;
            background-color: gray;
            text-align: center;
            line-height: 400px;
            font-size: 0px;
        }

        img {
            vertical-align: middle;
        }

        span {
            font-size: 40px;
            vertical-align: middle;
            background-color: orange;
        }
    </style>
</head>

<body>
    <div class="outer">
        <div class="inner">
            <span>出来玩啊？</span>
            <img src="../images/悟空.jpg" alt="">
        </div>
    </div>
</body>

</html>